import Taro, { Component } from "@tarojs/taro"
import { Provider } from "@tarojs/mobx"
// import Index from "./pages/index"

import "@/assets/style/global.less"

import counterStore from "./store/counter"

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

const store = {
    counterStore
}

wx.cloud.init({ env: "mp-database-6a0a21" })

class App extends Component {
    config = {
        pages: [
            "pages/Home/index",
            "pages/Discover/index",
            "pages/Information/index",
            "pages/PersonalCenter/index",
            "pages/MainFunction/index",
            "pages/SignIn/index",
            "pages/PostDetail/index"
        ],

        window: {
            backgroundTextStyle: "dark",
            navigationBarBackgroundColor: "#fff",
            navigationBarTitleText: "Image Life",
            navigationBarTextStyle: "black"
        },
        tabBar: {
            color: "#666666",
            selectedColor: "#00a383",
            list: [
                {
                    pagePath: "pages/Home/index",
                    iconPath: "./assets/icons/home-l.png",
                    selectedIconPath: "./assets/icons/home.png"
                },
                {
                    pagePath: "pages/Discover/index",
                    iconPath: "./assets/icons/discover-l.png",
                    selectedIconPath: "./assets/icons/discover.png"
                },
                {
                    pagePath: "pages/MainFunction/index",
                    iconPath: "./assets/icons/camera-l.png",
                    selectedIconPath: "./assets/icons/camera.png"
                },
                {
                    pagePath: "pages/Information/index",
                    iconPath: "./assets/icons/talk-l.png",
                    selectedIconPath: "./assets/icons/talk.png"
                },
                {
                    pagePath: "pages/PersonalCenter/index",
                    iconPath: "./assets/icons/mine-l.png",
                    selectedIconPath: "./assets/icons/mine.png"
                }
            ]
        }
    }

    componentDidMount() {}

    componentDidShow() {}

    componentDidHide() {}

    componentDidCatchError() {}

    // 在 App 类中的 render() 函数没有实际作用
    // 请勿修改此函数
    render() {
        return (
            <Provider store={store}>
                <Index />
            </Provider>
        )
    }
}

Taro.render(<App />, document.getElementById("app"))
